﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.SavedSearches
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using DnProcessSimulateCommands.AssignDataFromTC;
using System;
using System.Collections;
using System.Threading.Tasks;
using Tecnomatix.Engineering.Utilities;


namespace DnProcessSimulateCommands;

public static class SavedSearches
{
  public static readonly string General = "General...";
  public static readonly string Item = "Item...";
  public static readonly string ItemName = "Item Name";
  public static readonly string ItemID = "Item ID";
  public static readonly string ItemSimple = "Item - simple";
  public static readonly string ItemNameOrID = "Item_Name_or_ID";
  public static readonly string ItemRevision = "Item Revision...";
  public static readonly string LatestItemRevision = "Latest Item Revision...";
  public static readonly string Identifier = "Identifier...";
  public static readonly string KeywordSearch = "Keyword Search";
  public static readonly string Part = nameof (Part);
  public static readonly string Dataset = "Dataset...";
  public static readonly string DatasetName = "Dataset Name";
  public static readonly string DatasetKeywordSearch = "Dataset Keyword Search";

  internal static void HandleExceptions(this Task task, string problemsTitle)
  {
    task.ContinueWith((Action<Task>) (t =>
    {
      AggregateException aggregateException = t.Exception.Flatten();
      Hashtable hashtable = new Hashtable();
      foreach (Exception innerException in aggregateException.InnerExceptions)
        hashtable.Add((object) innerException.Message, (object) "MESSAGE");
      if (hashtable.Count <= 0)
        return;
      TxErrorWindow.ShowDialog(AssignDataFromTCResources.CMD_NAME, problemsTitle, hashtable, new Hashtable(), true);
    }), TaskContinuationOptions.OnlyOnFaulted);
  }
}
